<?php
require_once "tool/Mysql.php";
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$p = file_exists("../passwd") ? (trim(file_get_contents("../passwd"))) : null;
$db = new  yxmingy\Mysql('localhost',  'root', $p!=null ? $p : '123356');
if($db->connected()) {
    $db->dropTable("main.publiclist");
    $publiclist_table = new yxmingy\Table("main.publiclist");
    $publiclist_table->add("`list_id` INT UNSIGNED AUTO_INCREMENT");
    $publiclist_table->add("`name` VARCHAR(30) NOT NULL");
    $publiclist_table->add("`text` MEDIUMTEXT");
    $publiclist_table->add("UNIQUE KEY (`list_id`)");
    $publiclist_table->setAddition("DEFAULT CHARSET=utf8;");
    $db->createTable($publiclist_table);
    echo "Initialization Succeed.";
}